<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>自定义组件 | 个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/wx/三列选择器.html" />
    
    
    <link rel="prev" href="../../md/wx/封装外部ajax路径.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="6.2"
        data-chapter-title="自定义组件"
        data-filepath="md/wx/自定义组件.md"
        data-basepath="../.."
        data-revision="Wed Jan 09 2019 23:47:24 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/html/html介绍.html">
            
                
                    <a href="../../md/html/html介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/html/html常用标签.html">
            
                
                    <a href="../../md/html/html常用标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        html常用标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/html/a标签的使用.html">
            
                
                    <a href="../../md/html/a标签的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        a标签的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="md/html/表格的介绍.html">
            
                
                    <a href="../../md/html/表格的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        表格的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="md/html/列表.html">
            
                
                    <a href="../../md/html/列表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="md/html/iframe内嵌框架.html">
            
                
                    <a href="../../md/html/iframe内嵌框架.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        iframe内嵌框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="md/html/表单.html">
            
                
                    <a href="../../md/html/表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="md/html/媒体标签.html">
            
                
                    <a href="../../md/html/媒体标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        媒体标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="md/html/下拉框，多行文本域以及对齐方式.html">
            
                
                    <a href="../../md/html/下拉框，多行文本域以及对齐方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        清除样式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/css引入方式.html">
            
                
                    <a href="../../md/css/css引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css引入方式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/css/css选择符与选择器.html">
            
                
                    <a href="../../md/css/css选择符与选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择符与选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/css/css字体样式.html">
            
                
                    <a href="../../md/css/css字体样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        css字体样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/css/图片的调整.html">
            
                
                    <a href="../../md/css/图片的调整.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        图片的调整
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/css/伪类选择.html">
            
                
                    <a href="../../md/css/伪类选择.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        伪类选择
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/css/盒子模型.html">
            
                
                    <a href="../../md/css/盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/css/浮动.html">
            
                
                    <a href="../../md/css/浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/css/定位.html">
            
                
                    <a href="../../md/css/定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/css/阴影.html">
            
                
                    <a href="../../md/css/阴影.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        阴影
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="md/css/图片溢出处理.html">
            
                
                    <a href="../../md/css/图片溢出处理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        图片溢出处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="md/css/动画.html">
            
                
                    <a href="../../md/css/动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="md/css/动画插件与浏览器内核.html">
            
                
                    <a href="../../md/css/动画插件与浏览器内核.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        动画插件与浏览器内核
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="md/css/旋转菜单.html">
            
                
                    <a href="../../md/css/旋转菜单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        旋转菜单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="md/css/视口.html">
            
                
                    <a href="../../md/css/视口.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        移动端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="md/css/rem布局.html">
            
                
                    <a href="../../md/css/rem布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        rem布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="md/css/权重与雪碧图.html">
            
                
                    <a href="../../md/css/权重与雪碧图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        权重问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="md/css/移动底部菜单被系统键盘顶起问题.html">
            
                
                    <a href="../../md/css/移动底部菜单被系统键盘顶起问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        移动端导航问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="md/css/flex布局.html">
            
                
                    <a href="../../md/css/flex布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        flex布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="md/css/fullpage的使用.html">
            
                
                    <a href="../../md/css/fullpage的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        fullpage
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="md/css/bootstrap.html">
            
                
                    <a href="../../md/css/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="md/css/媒体查询.html">
            
                
                    <a href="../../md/css/媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/js/js的介绍.html">
            
                
                    <a href="../../md/js/js的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JavaScript的介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/js/JavaScript数据类型.html">
            
                
                    <a href="../../md/js/JavaScript数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        JavaScript数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/js/数据类型的转换.html">
            
                
                    <a href="../../md/js/数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/js/运算符.html">
            
                
                    <a href="../../md/js/运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="md/js/比较运算符.html">
            
                
                    <a href="../../md/js/比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="md/js/赋值运算符.html">
            
                
                    <a href="../../md/js/赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="md/js/逻辑操作符.html">
            
                
                    <a href="../../md/js/逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="md/js/条件语句.html">
            
                
                    <a href="../../md/js/条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="md/js/条件运算符.html">
            
                
                    <a href="../../md/js/条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="md/js/位运算符.html">
            
                
                    <a href="../../md/js/位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="md/js/循环语句.html">
            
                
                    <a href="../../md/js/循环语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        循环语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="md/js/for循环.html">
            
                
                    <a href="../../md/js/for循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        for循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="md/js/ES6.html">
            
                
                    <a href="../../md/js/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        ES6
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="md/js/es6安装.html">
            
                
                    <a href="../../md/js/es6安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        ES6安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.14" data-path="md/js/内置对象.html">
            
                
                    <a href="../../md/js/内置对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        内置对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="md/js/Array对象.html">
            
                
                    <a href="../../md/js/Array对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.15.</b>
                        
                        Array对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.16" data-path="md/js/Date对象.html">
            
                
                    <a href="../../md/js/Date对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.16.</b>
                        
                        Date对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.17" data-path="md/js/布尔值对象.html">
            
                
                    <a href="../../md/js/布尔值对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.17.</b>
                        
                        布尔值对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.18" data-path="md/js/数学对象.html">
            
                
                    <a href="../../md/js/数学对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.18.</b>
                        
                        数学对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.19" data-path="md/js/对象的创建.html">
            
                
                    <a href="../../md/js/对象的创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.19.</b>
                        
                        对象的创建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.20" data-path="md/js/BOM.html">
            
                
                    <a href="../../md/js/BOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.20.</b>
                        
                        BOM
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.21" data-path="md/js/DOM关于元素的获取.html">
            
                
                    <a href="../../md/js/DOM关于元素的获取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.21.</b>
                        
                        DOM关于元素的获取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.22" data-path="md/js/DOM元素对象.html">
            
                
                    <a href="../../md/js/DOM元素对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.22.</b>
                        
                        DOM元素对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.23" data-path="md/js/DOM事件练习.html">
            
                
                    <a href="../../md/js/DOM事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.23.</b>
                        
                        DOM事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.24" data-path="md/js/DOM鼠标事件.html">
            
                
                    <a href="../../md/js/DOM鼠标事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.24.</b>
                        
                        DOM鼠标事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.25" data-path="md/js/事件代理.html">
            
                
                    <a href="../../md/js/事件代理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.25.</b>
                        
                        事件代理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.26" data-path="md/js/移动端事件.html">
            
                
                    <a href="../../md/js/移动端事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.26.</b>
                        
                        移动端事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.27" data-path="md/js/无缝轮播图.html">
            
                
                    <a href="../../md/js/无缝轮播图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.27.</b>
                        
                        无缝轮播图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.28" data-path="md/js/鼠标事件练习.html">
            
                
                    <a href="../../md/js/鼠标事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.28.</b>
                        
                        鼠标事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.29" data-path="md/js/ajax.html">
            
                
                    <a href="../../md/js/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.29.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.30" data-path="md/js/封装ajax.html">
            
                
                    <a href="../../md/js/封装ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.30.</b>
                        
                        封装ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.31" data-path="md/js/高德地图的使用.html">
            
                
                    <a href="../../md/js/高德地图的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.31.</b>
                        
                        高德地图的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.32" data-path="md/js/预加载插件使用.html">
            
                
                    <a href="../../md/js/预加载插件使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.32.</b>
                        
                        预加载插件使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/jQuery/JQ变量的声明.html">
            
                
                    <a href="../../md/jQuery/JQ变量的声明.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        JQ变量的声明
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="md/jQuery/选择器和效果.html">
            
                
                    <a href="../../md/jQuery/选择器和效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        选择器和效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="md/jQuery/属性.html">
            
                
                    <a href="../../md/jQuery/属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="md/jQuery/尺寸.html">
            
                
                    <a href="../../md/jQuery/尺寸.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        尺寸
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="md/jQuery/遍历.html">
            
                
                    <a href="../../md/jQuery/遍历.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        遍历
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="md/jQuery/正则表达式.html">
            
                
                    <a href="../../md/jQuery/正则表达式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        正则表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="md/jQuery/jQuery事件练习.html">
            
                
                    <a href="../../md/jQuery/jQuery事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        jQuery事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="md/jQuery/操作.html">
            
                
                    <a href="../../md/jQuery/操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="md/jQuery/事件.html">
            
                
                    <a href="../../md/jQuery/事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="md/jQuery/ajax.html">
            
                
                    <a href="../../md/jQuery/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.10" data-path="md/jQuery/三级联动.html">
            
                
                    <a href="../../md/jQuery/三级联动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.10.</b>
                        
                        三级联动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.11" data-path="md/jQuery/滚动监听导航效果.html">
            
                
                    <a href="../../md/jQuery/滚动监听导航效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.11.</b>
                        
                        滚动监听导航效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.12" data-path="md/jQuery/悬停导航.html">
            
                
                    <a href="../../md/jQuery/悬停导航.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.12.</b>
                        
                        悬停导航
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="md/Vue/修饰符与条件渲染.html">
            
                
                    <a href="../../md/Vue/修饰符与条件渲染.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Vue修饰符与条件渲染
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="md/Vue/绑定class和style.html">
            
                
                    <a href="../../md/Vue/绑定class和style.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        绑定class和style
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="md/Vue/排序.html">
            
                
                    <a href="../../md/Vue/排序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="md/Vue/表单输入绑定.html">
            
                
                    <a href="../../md/Vue/表单输入绑定.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        表单输入绑定
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="md/Vue/生命周期.html">
            
                
                    <a href="../../md/Vue/生命周期.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        生命周期
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="md/Vue/自定义指令.html">
            
                
                    <a href="../../md/Vue/自定义指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        自定义指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="md/Vue/组件.html">
            
                
                    <a href="../../md/Vue/组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="md/Vue/Vue事件练习.html">
            
                
                    <a href="../../md/Vue/Vue事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        Vue事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="md/Vue/动态模板.html">
            
                
                    <a href="../../md/Vue/动态模板.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        动态模板
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="md/Vue/插槽的使用.html">
            
                
                    <a href="../../md/Vue/插槽的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        插槽的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="md/Vue/router.html">
            
                
                    <a href="../../md/Vue/router.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.11" data-path="md/Vue/ajax与框架搭建.html">
            
                
                    <a href="../../md/Vue/ajax与框架搭建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.11.</b>
                        
                        ajax与框架搭建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.12" data-path="md/Vue/store.html">
            
                
                    <a href="../../md/Vue/store.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.12.</b>
                        
                        store
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.13" data-path="md/Vue/ref获取元素.html">
            
                
                    <a href="../../md/Vue/ref获取元素.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.13.</b>
                        
                        ref获取元素
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="md/wx/小程序.html">
            
                
                    <a href="../../md/wx/小程序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        小程序
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="md/wx/封装外部ajax路径.html">
            
                
                    <a href="../../md/wx/封装外部ajax路径.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        封装外部ajax路径
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="6.2" data-path="md/wx/自定义组件.html">
            
                
                    <a href="../../md/wx/自定义组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        自定义组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="md/wx/三列选择器.html">
            
                
                    <a href="../../md/wx/三列选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        三列选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="md/wx/练习.html">
            
                
                    <a href="../../md/wx/练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        练习
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="md/Egret/canvas.html">
            
                
                    <a href="../../md/Egret/canvas.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        canvas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="md/Egret/async.html">
            
                
                    <a href="../../md/Egret/async.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        async
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="md/Egret/显示对象与容器.html">
            
                
                    <a href="../../md/Egret/显示对象与容器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        显示对象与容器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="md/Egret/01.基础.html">
            
                
                    <a href="../../md/Egret/01.基础.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        01.基础
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="md/Egret/02.对象池.html">
            
                
                    <a href="../../md/Egret/02.对象池.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        02.对象池
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="md/Egret/03.typeScript.html">
            
                
                    <a href="../../md/Egret/03.typeScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        03.typeScript
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="md/Egret/04.场景管理类.html">
            
                
                    <a href="../../md/Egret/04.场景管理类.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        04.场景管理类
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="gitbook的安装.html">
            
                
                    <a href="../../gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        gitbook的安装
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <p>&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x7528;&#x6765;&#x88C5;&#x7EC4;&#x4EF6;&#xFF0C;&#x65B0;&#x52A0;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;table&#x7684;component&#x7EC4;&#x4EF6;&#x7684;&#x6587;&#x4EF6;&#x660E;&#xFF0C;(table)&#x4E3A;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x540D;&#x5B57;</p>
<p>&#x5728;table.json&#x6587;&#x4EF6;&#x4E2D;&#x8FDB;&#x884C;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x58F0;&#x660E;&#xFF08;&#x5C06; component &#x5B57;&#x6BB5;&#x8BBE;&#x4E3A; true &#x53EF;&#x8FD9;&#x4E00;&#x7EC4;&#x6587;&#x4EF6;&#x8BBE;&#x4E3A;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#xFF09;</p>
<pre><code>{
  &quot;component&quot;:true,
  &quot;usingComponents&quot;:{}//&#x7528;&#x6765;&#x5F15;&#x7528;&#x5176;&#x4ED6;&#x7EC4;&#x4EF6;
}
</code></pre><p>&#x5728;table.wxml&#x4E2D;&#x5199;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x7684;&#x5185;&#x90E8;WXML&#x7ED3;&#x6784;</p>
<pre><code class="lang-`">    <view class="table">
      <view class="thead">
        <view class="tr">
          <view class="th" wx:for="{/{tableThemes}/}" wx:key="{/{index}/}">{/{item}/}</view>
        </view>
      </view>
      <view class="tbody">
        <view class="tr" wx:for="{/{tableItems}/}" wx:key="{/{index}/}">
          <view class="td" wx:for="{/{item}/}" wx:key="{/{index}/}">{/{item}/}</view>
        </view>
      </view>
    </view>
</code></pre>
<p>&#x5728;table.wss&#x4E2D;&#x5199;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x7684;&#x6837;&#x5F0F;&#xFF08;&#x6837;&#x5F0F;&#x53EA;&#x5E94;&#x7528;&#x4E8E;&#x8FD9;&#x4E2A;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#xFF09;</p>
<p>&#x5728;&#x7EC4;&#x4EF6;wxss&#x4E2D;&#x4E0D;&#x5E94;&#x4F7F;&#x7528;ID&#x9009;&#x62E9;&#x5668;&#x3001;&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;&#x548C;&#x6807;&#x7B7E;&#x540D;&#x9009;&#x62E9;&#x5668;</p>
<pre><code>.table{
  display: table;
  border-collapse: collapse;
  color: grey;
  font-size: 32rpx;
  text-align: center;
  vertical-align: middle;
  width: 100%;
}
.table .tr{
  display: table-row;
  height: 60rpx;
  vertical-align: middle;
  line-height: 60rpx;
}
.table .thead{
  display: table-header-group;
}
.table .thead .tr{
  background: #eee;
}
.table .tbody{
  display: table-row-group;
}
.table .tr .th,.table .tr .td{
  display: table-cell;
  border: 1px solid #ddd;
}
</code></pre><p>&#x5728;table.js&#x6587;&#x4EF6;&#x4E2D;&#x4F7F;&#x7528; Component() &#x6765;&#x6CE8;&#x518C;&#x7EC4;&#x4EF6;&#xFF0C;&#x5E76;&#x63D0;&#x4F9B;&#x7EC4;&#x4EF6;&#x7684;&#x5C5E;&#x6027;&#x5B9A;&#x4E49;&#x3001;&#x5185;&#x90E8;&#x6570;&#x636E;&#x548C;&#x81EA;&#x5B9A;&#x4E49;&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x7EC4;&#x4EF6;&#x7684;&#x5C5E;&#x6027;&#x503C;&#x548C;&#x5185;&#x90E8;&#x6570;&#x636E;&#x5C06;&#x88AB;&#x7528;&#x4E8E;&#x7EC4;&#x4EF6; wxml &#x7684;&#x6E32;&#x67D3;&#xFF0C;&#x5176;&#x4E2D;&#xFF0C;&#x5C5E;&#x6027;&#x503C;&#x662F;&#x53EF;&#x7531;&#x7EC4;&#x4EF6;&#x5916;&#x90E8;&#x4F20;&#x5165;&#x7684;&#x3002;</p>
<pre><code>Component({
  properties: {
    // &#x8FD9;&#x91CC;&#x5B9A;&#x4E49;&#x4E86;&#x5C5E;&#x6027;&#xFF0C;&#x5C5E;&#x6027;&#x503C;&#x53EF;&#x4EE5;&#x5728;&#x7EC4;&#x4EF6;&#x4F7F;&#x7528;&#x65F6;&#x6307;&#x5B9A;
    tableThemes: {
      type: Object, // &#x56E0;&#x6B64;&#x5904;&#x7684;thead&#x662F;json&#x683C;&#x5F0F;&#xFF0C;&#x6545;&#x5C06;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x8BBE;&#x7F6E;&#x4E3A;object
    },
    tableItems: {
      type: Array,
    }
  },
  data: {
    // &#x8FD9;&#x91CC;&#x662F;&#x4E00;&#x4E9B;&#x7EC4;&#x4EF6;&#x5185;&#x90E8;&#x6570;&#x636E;
    someData: {}
  },
  methods: {
    // &#x8FD9;&#x91CC;&#x662F;&#x4E00;&#x4E2A;&#x81EA;&#x5B9A;&#x4E49;&#x65B9;&#x6CD5;
    customMethod: function(){}
  }
})
</code></pre><h1 id="&#x4F7F;&#x7528;&#x7EC4;&#x4EF6;">&#x4F7F;&#x7528;&#x7EC4;&#x4EF6;</h1>
<p>&#x4F7F;&#x7528;&#x5DF2;&#x6CE8;&#x518C;&#x7684;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x524D;&#xFF0C;&#x9996;&#x5148;&#x8981;&#x5728;&#x9875;&#x9762;&#x7684; json &#x6587;&#x4EF6;&#x4E2D;&#x8FDB;&#x884C;&#x5F15;&#x7528;&#x58F0;&#x660E;&#x3002;</p>
<pre><code>{
    &quot;usingComponents&quot;: {
        &quot;table&quot;: &quot;/components/table/table&quot;
     }
}
</code></pre><p>&#x5728;&#x9875;&#x9762;&#x7684;wxml&#x6587;&#x4EF6;&#x4E2D;&#x5F15;&#x7528;&#x7EC4;&#x4EF6;&#x3002;</p>
<pre><code>&lt;table tableThemes=&quot;&quot; tableItems=&quot;&quot;&gt;&lt;/table&gt;
</code></pre><p>&#x5728;&#x9875;&#x9762;&#x7684;js&#x6587;&#x4EF6;&#x4E2D;&#x63D0;&#x4F9B;&#x5C5E;&#x6027;&#x7684;&#x6570;&#x636E;&#x3002;</p>
<pre><code>data:{
    themeArr: { nickName: &apos;&#x6635;&#x79F0;&apos;, age: &apos;&#x5E74;&#x9F84;&apos;, tell: &apos;&#x7535;&#x8BDD;&apos;, address: &apos;&#x4F4F;&#x5740;&apos; },
    itemArr: [
      { nickName: &apos;Anna&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
      { nickName: &apos;Tina&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
      { nickName: &apos;Tom&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
      { nickName: &apos;Alex&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
      { nickName: &apos;Hallen&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
      { nickName: &apos;Lucy&apos;, age: 25, tell: 121243423424, address: &apos;tianfuStreet&apos; },
    ]
}
</code></pre><h1 id="&#x7B2C;&#x4E8C;&#x79CD;">&#x7B2C;&#x4E8C;&#x79CD;</h1>
<p>&#x6587;&#x4EF6;&#x4E2D;&#x7F16;&#x5199;&#x5F39;&#x7A97;&#x7EC4;&#x4EF6;&#x6A21;&#x7248;&#xFF0C;&#x5728; dialog.wxss &#x6587;&#x4EF6;&#x4E2D;&#x52A0;&#x5165;&#x5F39;&#x7A97;&#x7EC4;&#x4EF6;&#x6837;&#x5F0F;&#xFF0C;&#x5B83;&#x4EEC;&#x7684;&#x5199;&#x6CD5;&#x4E0E;&#x9875;&#x9762;&#x7684;&#x5199;&#x6CD5;&#x7C7B;&#x4F3C;&#xFF0C;</p>
<p>dialog.wxml &#x6587;&#x4EF6;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>&lt;view class=&apos;wx_dialog_container&apos; hidden=&quot;{/{/!isShow/}/}&quot;&gt;
    &lt;view class=&apos;wx-mask&apos;&gt;&lt;/view&gt;
    &lt;view class=&apos;wx-dialog&apos;&gt;
        &lt;view class=&apos;wx-dialog-title&apos;&gt;{/{ title }/}&lt;/view&gt;
        &lt;view class=&apos;wx-dialog-content&apos;&gt;{/{ content }/}&lt;/view&gt;
        &lt;view class=&apos;wx-dialog-footer&apos;&gt;
          &lt;view class=&apos;wx-dialog-btn&apos; catchtap=&apos;_cancelEvent&apos;&gt;{/{ cancelText }/}&lt;/view&gt;
          &lt;view class=&apos;wx-dialog-btn&apos; catchtap=&apos;_confirmEvent&apos;&gt;{/{ confirmText }/}&lt;/view&gt;
        &lt;/view&gt;
    &lt;/view&gt;
&lt;/view&gt;
</code></pre><p>dialog.wxss &#x6587;&#x4EF6;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>.wx-mask{
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
}
.wx-dialog{
position: fixed;
z-index: 5000;
width: 80%;
max-width: 600rpx;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #FFFFFF;
text-align: center;
border-radius: 3px;
overflow: hidden;
}
.wx-dialog-title{
font-size: 18px;
padding: 15px 15px 5px;
}
.wx-dialog-content{
padding: 15px 15px 5px;
min-height: 40px;
font-size: 16px;
line-height: 1.3;
word-wrap: break-word;
word-break: break-all;
color: #999999;
}
.wx-dialog-footer{
display: flex;
align-items: center;
position: relative;
line-height: 45px;
font-size: 17px;
}
.wx-dialog-footer::before{
content: &apos;&apos;;
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1px solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.wx-dialog-btn{
display: block;
-webkit-flex: 1;
flex: 1;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(1){
color: #353535;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(2){
color: #3CC51F;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(2):after{
content: &quot; &quot;;
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 1px solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
</code></pre><p>dialog.js &#x662F;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x7684;&#x6784;&#x9020;&#x5668;&#xFF0C;&#x662F;&#x4F7F;&#x7528;&#x5C0F;&#x7A0B;&#x5E8F;&#x4E2D; Component &#x6784;&#x9020;&#x5668;&#x751F;&#x6210;&#x7684;&#xFF0C;&#x8C03;&#x7528; Component &#x6784;&#x9020;&#x5668;&#x65F6;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x6307;&#x5B9A;&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;&#x7684;&#x5C5E;&#x6027;&#x3001;&#x6570;&#x636E;&#x3001;&#x65B9;&#x6CD5;&#x7B49;&#xFF0C;</p>
<pre><code>// components/Dialog/dialog.js
Component({
  options: {
    multipleSlots: true // &#x5728;&#x7EC4;&#x4EF6;&#x5B9A;&#x4E49;&#x65F6;&#x7684;&#x9009;&#x9879;&#x4E2D;&#x542F;&#x7528;&#x591A;slot&#x652F;&#x6301;
  },
  /**
   * &#x7EC4;&#x4EF6;&#x7684;&#x5C5E;&#x6027;&#x5217;&#x8868;
   * &#x7528;&#x4E8E;&#x7EC4;&#x4EF6;&#x81EA;&#x5B9A;&#x4E49;&#x8BBE;&#x7F6E;
   */
  properties: {
    // &#x5F39;&#x7A97;&#x6807;&#x9898;
    title: {            // &#x5C5E;&#x6027;&#x540D;
      type: String,     // &#x7C7B;&#x578B;&#xFF08;&#x5FC5;&#x586B;&#xFF09;&#xFF0C;&#x76EE;&#x524D;&#x63A5;&#x53D7;&#x7684;&#x7C7B;&#x578B;&#x5305;&#x62EC;&#xFF1A;String, Number, Boolean, Object, Array, null&#xFF08;&#x8868;&#x793A;&#x4EFB;&#x610F;&#x7C7B;&#x578B;&#xFF09;
      value: &apos;&#x6807;&#x9898;&apos;     // &#x5C5E;&#x6027;&#x521D;&#x59CB;&#x503C;&#xFF08;&#x53EF;&#x9009;&#xFF09;&#xFF0C;&#x5982;&#x679C;&#x672A;&#x6307;&#x5B9A;&#x5219;&#x4F1A;&#x6839;&#x636E;&#x7C7B;&#x578B;&#x9009;&#x62E9;&#x4E00;&#x4E2A;
    },
    // &#x5F39;&#x7A97;&#x5185;&#x5BB9;
    content :{
      type : String ,
      value : &apos;&#x5F39;&#x7A97;&#x5185;&#x5BB9;&apos;
    },
    // &#x5F39;&#x7A97;&#x53D6;&#x6D88;&#x6309;&#x94AE;&#x6587;&#x5B57;
    cancelText :{
      type : String ,
      value : &apos;&#x53D6;&#x6D88;&apos;
    },
    // &#x5F39;&#x7A97;&#x786E;&#x8BA4;&#x6309;&#x94AE;&#x6587;&#x5B57;
    confirmText :{
      type : String ,
      value : &apos;&#x786E;&#x5B9A;&apos;
    } 
  },

  /**
   * &#x79C1;&#x6709;&#x6570;&#x636E;,&#x7EC4;&#x4EF6;&#x7684;&#x521D;&#x59CB;&#x6570;&#x636E;
   * &#x53EF;&#x7528;&#x4E8E;&#x6A21;&#x7248;&#x6E32;&#x67D3;
   */
  data: {
    // &#x5F39;&#x7A97;&#x663E;&#x793A;&#x63A7;&#x5236;
    isShow:false
  },

  /**
   * &#x7EC4;&#x4EF6;&#x7684;&#x65B9;&#x6CD5;&#x5217;&#x8868;
   * &#x66F4;&#x65B0;&#x5C5E;&#x6027;&#x548C;&#x6570;&#x636E;&#x7684;&#x65B9;&#x6CD5;&#x4E0E;&#x66F4;&#x65B0;&#x9875;&#x9762;&#x6570;&#x636E;&#x7684;&#x65B9;&#x6CD5;&#x7C7B;&#x4F3C;
   */
  methods: {
    /*
     * &#x516C;&#x6709;&#x65B9;&#x6CD5;
     */

    //&#x9690;&#x85CF;&#x5F39;&#x6846;
    hideDialog(){
      this.setData({
        isShow: !this.data.isShow
      })
    },
    //&#x5C55;&#x793A;&#x5F39;&#x6846;
    showDialog(){
      this.setData({
        isShow: !this.data.isShow
      })
    },
     /*
     * &#x5185;&#x90E8;&#x79C1;&#x6709;&#x65B9;&#x6CD5;&#x5EFA;&#x8BAE;&#x4EE5;&#x4E0B;&#x5212;&#x7EBF;&#x5F00;&#x5934;
     * triggerEvent &#x7528;&#x4E8E;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;
     */
     // &#x5FAE;&#x4FE1;&#x5C0F;&#x7A0B;&#x5E8F;&#x4E2D;&#x662F;&#x901A;&#x8FC7;triggerEvent&#x6765;&#x7ED9;&#x7236;&#x7EC4;&#x4EF6;&#x4F20;&#x9012;&#x4FE1;&#x606F;&#x7684;
    _cancelEvent(){
      //&#x89E6;&#x53D1;&#x53D6;&#x6D88;&#x56DE;&#x8C03;
      this.triggerEvent(&quot;cancelEvent&quot;)
    },
    _confirmEvent(){
      //&#x89E6;&#x53D1;&#x6210;&#x529F;&#x56DE;&#x8C03;
      this.triggerEvent(&quot;confirmEvent&quot;);
    }
  }
})
</code></pre><p>&#x9996;&#x5148;&#x9700;&#x8981;&#x5728; &#x9875;&#x9762;.json &#x4E2D;&#x5F15;&#x5165;&#x7EC4;&#x4EF6;&#xFF1A;</p>
<pre><code>{
  &quot;usingComponents&quot;: {
    &quot;dialog&quot;: &quot;/components/Dialog/dialog&quot;
  }
}
</code></pre><p>&#x7136;&#x540E;&#x6211;&#x4EEC;&#x5728; &#x9700;&#x8981;&#x5C55;&#x793A;&#x7684;&#x9875;&#x9762;.wxml &#x4E2D;&#x5F15;&#x5165;&#x5B83;&#xFF0C;&#x5E76;&#x589E;&#x52A0;&#x6211;&#x4EEC;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x4E00;&#x4E9B;&#x503C;&#xFF0C;&#x5982;&#x4E0B;</p>
<pre><code>&lt;view class=&quot;container&quot;&gt;
    &lt;dialog id=&apos;dialog&apos; 
      title=&apos;&#x6211;&#x662F;&#x6807;&#x9898;&apos; 
      content=&apos;&#x606D;&#x559C;&#x4F60;&#xFF0C;&#x5B66;&#x4F1A;&#x4E86;&#x5C0F;&#x7A0B;&#x5E8F;&#x7EC4;&#x4EF6;&apos; 
      cancelText=&apos;&#x77E5;&#x9053;&#x4E86;&apos; 
      confirm=&apos;&#x8C22;&#x8C22;&#x4F60;&apos;
      &lt;--&#x8FD9;&#x91CC;&#x7684;cancelEvent/confirmEvent&#x5C31;&#x662F;&#x4F60;&#x5728;&#x5B9A;&#x4E49;&#x5B50;&#x7EC4;&#x4EF6;&#x65F6;&#x901A;&#x8FC7;triggerEvent&#x4F20;&#x9012;&#x8FC7;&#x6765;&#x7684;&#x4E8B;&#x4EF6;&#x540D;.--&gt;
      bind:cancelEvent=&quot;_cancelEvent&quot;  
      bind:confirmEvent=&quot;_confirmEvent&quot;&gt;
    &lt;/dialog&gt;

    &lt;button type=&quot;primary&quot; bindtap=&quot;showDialog&quot;&gt; ClickMe! &lt;/button&gt;
&lt;/view&gt;
</code></pre><p>&#x8FD8;&#x5DEE;&#x6700;&#x540E;&#x4E00;&#x6B65;&#xFF0C; &#x9700;&#x8981;&#x5C55;&#x793A;&#x7684;&#x9875;&#x9762;.js &#x914D;&#x7F6E;</p>
<pre><code>const app = getApp()
Page({
/**
* &#x751F;&#x547D;&#x5468;&#x671F;&#x51FD;&#x6570;--&#x76D1;&#x542C;&#x9875;&#x9762;&#x521D;&#x6B21;&#x6E32;&#x67D3;&#x5B8C;&#x6210;
*/
onReady: function () {
//&#x83B7;&#x5F97;dialog&#x7EC4;&#x4EF6;
this.dialog = this.selectComponent(&quot;#dialog&quot;);
},
showDialog(){
this.dialog.showDialog();
},
//&#x53D6;&#x6D88;&#x4E8B;&#x4EF6;
_cancelEvent(){
console.log(&apos;&#x4F60;&#x70B9;&#x51FB;&#x4E86;&#x53D6;&#x6D88;&apos;);
this.dialog.hideDialog();
},
//&#x786E;&#x8BA4;&#x4E8B;&#x4EF6;
_confirmEvent(){
console.log(&apos;&#x4F60;&#x70B9;&#x51FB;&#x4E86;&#x786E;&#x5B9A;&apos;);
this.dialog.hideDialog();
}
})
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/wx/封装外部ajax路径.html" class="navigation navigation-prev " aria-label="Previous page: 封装外部ajax路径"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/wx/三列选择器.html" class="navigation navigation-next " aria-label="Next page: 三列选择器"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
